$(function(){
	
	var $btnSave = $('#btnSave');
	$btnSave.click(function(){
	
		msgSave();
	});
	
});

function msgSave(){
	var $id 		= $('#hd_id');
	var $type 		= $('#type');
	var $title 		= $('#title');
	var $content 	= $('#content');
	var $reply 		= $('#reply');


	var id 			= $id.val();
	var type 		= $('input[name="type"]:checked').val();
	var title 		= $title.val();	
	var content 	= editorContent.getData();
	var reply 		= editorReply.getData();
	var status 		= $('input[name="status"]:checked').val();
	var disabled 	= $('input[name="disabled"]:checked').val();
	
	var params = {
		'id':id,
		'type':type,
		'title':title,
		'content':content,
		'reply':reply,
		'status':status,
		'disabled':disabled
	}
	
	$.post('/index.php/Admin/Message/update',params,function(data){
		if(data.success){
			location.reload(true);
			alert('保存修改成功');
		}else{
			alert('保存修改失败');
		}
	},'json');
}